package com.webtest.demo;

import java.awt.Desktop.Action;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.openqa.selenium.WebDriver;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import com.webtest.core.WebTestListener2;



@Listeners({WebTestListener2.class})
public class CrossearthPageTest extends BaseDriver{
	
	CrossearthPage crossearthPage;
	
	@BeforeMethod
	public void init() throws InterruptedException {
		resetEmulatorState();
		crossearthPage=new CrossearthPage(driver);	
	}


	private void resetEmulatorState() {
		
	}
	

	//一、点击软件后的首页面
	@Test(priority = 1,description = "单击进入CrossEarth登录页面")	
	public void enterCrossearthhomepage() throws InterruptedException {
		crossearthPage.homepage();
		crossearthPage.goback();
	}

	@Test(priority = 2,description = "Shift + Tab + Enter进入CrossEarth登录页面")	
	public void shifttabenterCrossearthhomepage() throws InterruptedException {
		crossearthPage.shifttabenterHomepage();		
		crossearthPage.goback();
	}

	@Test(priority = 3,description = "Ctrl + A + Enter + Enter进入CrossEarth登陆页面")	
	public void ctrladoubleenterCrossearthhomepage() throws InterruptedException {
		crossearthPage.ctrladoubleenterHomepage();
		crossearthPage.goback();
	}
	
	@Test(priority = 4,description = "Enter + Enter进入CrossEarth登陆页面")	
	public void doubleenterCrossearthhomepage() throws InterruptedException {
		crossearthPage.doubleenterHomepage();
		crossearthPage.goback();		
	}
	
	@Test(priority = 5,description = "Enter选中开始标志后释放，再单击进入CrossEarth登陆页面")	
	public void releaseenterCrossearthhomepage() throws InterruptedException {
		crossearthPage.releaseenterHomepage();
		crossearthPage.goback();		
	}

	//二、真知板块页面
	@Test(priority = 42,description = "查看真知模块能否正常打开")	
	public void opentruthmodule() throws InterruptedException {
		crossearthPage.opentruthModules();
		crossearthPage.goback();
		Thread.sleep(1000);
	}
	
	@Test(priority = 43,description = "使用键盘方向键进行翻页操作")	
	public void keybordturnpagetruthmodule() throws InterruptedException {
		crossearthPage.keybordturnpagetruthmodule();
		crossearthPage.goback();
		Thread.sleep(1000);
	}
	
	@Test(priority = 44,description = "使用鼠标单机事件进行查看第四个故事")	
	public void mouseclicktruthmodule() throws InterruptedException {
		crossearthPage.mouseclicktruthModules();
	}
	
	@Test(priority = 45,description = "鼠标侧拉选择南北朝")	
	public void mousesidepulltruthmodule() throws InterruptedException {
		//crossearthPage.enter();
		//crossearthPage.enter();
		crossearthPage.mousesidepulltruthModules();
		crossearthPage.goback();
	}
	
}
